﻿#region Using

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;

using Gizmox.WebGUI.Common;
using Gizmox.WebGUI.Forms;
using System.Data.SqlClient;
using TVC.Layout;
using System.Collections;

#endregion

namespace TVC.Modules.test
{
    public partial class testgroup : ModuleParent, IHostedApplication
    {
        public testgroup()
        {
            InitializeComponent();
            lookupBox2.SetDropDownWith(500);
        }

        private void testgroup_Load(object sender, EventArgs e)
        {
            DataTable _dtContract = null;
            BUS.ContractControl ctrcontract = new BUS.ContractControl();

            if (GetMainForm().PODInfo.Business_ID == "HL") _dtContract = ctrcontract.GetAll_Contract(ref sErr);
            else _dtContract = ctrcontract.GetAll_Contract1(ref sErr);

            lookupBox1.DisplayMember = "Contract";
            lookupBox1.ValueMember = "Contract";
            lookupBox1.MainForm = GetMainForm();
            lookupBox1.Lookup = "cboCTPO";

            lookupBox1.DataSource = _dtContract;

            lookupBox2.DisplayMember = "Code";
            lookupBox2.ValueMember = "Contract";
            lookupBox2.MainForm = GetMainForm();
            lookupBox2.Lookup = "cboCTPO";

            lookupBox2.DataSource = _dtContract.Copy();

            lookupBox1.Value = "";
            lookupBox2.Value = "";
        }

        private void myTextBox1_Click(object sender, EventArgs e)
        {

        }

        public void InitializeApplication()
        {

        }

        public void SetObject(object pbj)
        {
        }

        public HostedToolBarElement[] GetToolBarElements()
        {
            ArrayList objElements = new ArrayList();
            return (HostedToolBarElement[])objElements.ToArray(typeof(HostedToolBarElement));
        }

        public void OnToolBarButtonClick(HostedToolBarButton objButton, EventArgs objEvent)
        {

        }

        private void simpleControl1_FileOk(object sender, EventArgs e)
        {
            var myFiles = simpleControl1.Files;

            foreach (var myFile in myFiles)
            {
                MessageBox.Show("You uploaded a file with name: " + myFile.PostedFileName);
            }
        }
    }
}